package com.zrh.jsd.service.studydemo.common_thread;

import lombok.SneakyThrows;

import java.util.Vector;

public class TestThread extends Thread{
    private static int num = 1;
    private static int count = 1;
    @SneakyThrows
    @Override
    public void run() {
        System.out.println("num====="+num); //输出：10
        System.out.println("count==="+count); // 输出：1
        Thread.sleep(10);
        System.out.println("count==="+count); // 输出：20
    }

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new TestThread();
        System.out.println(thread.getId());
        thread.interrupt();
//        thread.stop();
        num = 10;
        thread.start();
        Thread.sleep(10);
        count = 20;

        Vector v = new Vector();
    }
}
